<template>
  <div>
    <div class="container" @click="closegallary">
      <div class="box">
        <swiper :options="swiperOption">
          <swiper-slide v-for="(item, index) in bannergallary" :key="index">
            <img :src="item" />
          </swiper-slide>

          <div class="swiper-pagination" slot="pagination"></div>
        </swiper>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Gallary",
  props: {
    bannergallary: Array
  },
  data() {
    return {
      swiperOption: {
        pagination: ".swiper-pagination",
        paginationType: "fraction",
        observer: true,
        observeParents: true
      },
    };
  },
  methods:{
      closegallary() {
          this.$emit('close')
      }

  }
};
</script>

<style scoped>
.container >>> .swiper-container {
  overflow: inherit;
}
.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 1;
}
.box {
  height: 0;
  padding-bottom: 100%;
  background: #eee;
}
img {
  width: 100%;
}
.swiper-pagination {
  bottom: -1.5rem;
  color: #fff;
}
</style>